﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="MuaHang.aspx.cs" Inherits="Cart.MuaHang" %>

<%@ Register Assembly="vdc_AJAXPage" Namespace="VdcInc" TagPrefix="vajax" %>


<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <script type="text/javascript" charset="utf-8">
        function fnDatMua() {
            ob_post.post(null, "vDatMua", ResultfnDatMua);
        }
        function ResultfnDatMua(result, ex) {
            alert(result);
            window.location = "TrangChu.aspx";
        }

        function fnChangeSoLuong(ddl, id) {
            var a = ddl.options[ddl.selectedIndex].value;
            //alert(a + "||" + id);
            ob_post.AddParam('strSanphamid', id);
            ob_post.AddParam('strSoLuongSanPham', a);
            ob_post.post(null, "vThayDoiSoLuong", ResultThayDoiSoLuong);
        }
        function ResultThayDoiSoLuong(result, ex) {

        }
        function fnDelSanPham(id)
        {
            // alert(id);
            var answer = confirm("Bạn có chắc muốn xóa sản phẩm này ra khỏi giỏ hàng không ?")
            if (answer) {
                ob_post.AddParam('strSanphamid', id);
                ob_post.post(null, "vDelSanPham", ResultDelSanPham);
            }
        }
        function ResultDelSanPham(result, ex) {
            window.location = "MuaHang.aspx";
        }
    </script>
    <div class="content_buy_cart">
        <div class="buy_cart_top">
        </div>

        <div class="buy_cart_content">
            <div class="buy_cart_breadcrumbs">
            </div>

            <!-- cart-detail-begin -->
            <p class="buy_cart_title">
                THÔNG TIN ĐƠN HÀNG
            </p>

            <!-- cart-view-begin -->
            <div class="buy_cart_content_title">
                <span class="content_title_delete">Xóa
                </span>

                <span class="content_title_product">Sản phẩm / Dịch vụ
                </span>

                <span class="content_title_price">Đơn giá
                </span>

                <span class="content_title_quanlity">Số lượng
                </span>

               
            </div>

            <table class="table_buy_cart_content" border="0" cellpadding="0" cellspacing="0">
                
                <tbody>
                    
                    
                     
                            <asp:Repeater ID="lvDanhSach" runat="server">
                                
                                <ItemTemplate>
                                    <tr>
                                        <td class="cart_content_delete"><a class="delete" href="#" onclick="fnDelSanPham('<%# Eval("Id") %>')" id="cart_delete_710_1211" title=""></a></td>
                                        <td class="cart_content_product"><%# Eval("Ten") %></td>
                                        <td class="cart_content_price"><%# Eval("Gia") %></td>
                                        <td class="cart_content_quanlity">
                                            <asp:DropDownList ID="ddlSoLuong" runat="server" DataSource='<%# AddDataSource() %>' DataTextField="Value" DataValueField="Key"
                                                SelectedValue='<%# Eval("SoLuongMua") %>' onchange='<%# Eval("Id","fnChangeSoLuong(this,{0})") %>'>
                                            </asp:DropDownList>
                                        </td>
                                        
                                        
                                        </tr>
                                </ItemTemplate>
                                
                            </asp:Repeater>
                     </tr>
                                                               
                    <tr>
                        
                        <td class="cart_content_total_title" colspan="3">TỔNG CỘNG</td>
                        <td>
                            <vajax:CallbackPanel runat="server" ID="cbpTongTien">
                            <Content>
                                    <label runat="server" id="lbTongTien1"></label>    
                                </Content>
                                </vajax:CallbackPanel>
                               
                        </td>
                                 
                    </tr>
                </tbody>

            </table>
            <!-- cart-view-end -->

            <!-- cart-detail-end -->

            <p class="clear">
            </p>
            <p class="clear">
            </p>
            <p class="clear">
            </p>

            <!-- cart-button-begin -->
            <div class="buy_cart_button">
                <div class="cart_button_left">
                    <a class="button_order_2" href="TrangChu.aspx" title="">&gt;&gt; Muốn mua thêm</a>

                    <p class="tooltip_cart" style="display: none;">
                        Khi muốn mua thêm nhiều sản phẩm khác
                    </p>
                </div>

                <div class="cart_button_right">
                    <a class="button_checkout" name="button_checkout" href="#" onclick="fnDatMua(); return false;" rel="" title=""></a>

                    <p class="tooltip_cart" style="display: none;">
                        Mua hàng, giao hàng và thu tiền tận nơi
                    </p>
                </div>
            </div>
            <!-- cart-button-end -->

            <p class="clear">
            </p>
            <p class="clear">
            </p>
            <div id="ctl00_content_divLogin">
                <asp:PlaceHolder runat="server" ID="plHolder"></asp:PlaceHolder>
            </div>
        </div>

        <div class="buy_cart_bottom">
        </div>
    </div>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" runat="server">
    <vajax:CallbackPanel runat="server" ID="cbpTongSanPham">
        <Content>
            <div class="cart_right">
                <p>
                    <label runat="server" id="lbTongSanPham"></label>
                    &nbsp; Sản phẩm</p>
                <p>
                    <span class="text_bold">
                        <label runat="server" id="lbTongTien"></label>
                        &nbsp; đ</span>
                </p>
            </div>
        </Content>
    </vajax:CallbackPanel>
</asp:Content>
